package com.roadmap.util.mail;

import com.roadmap.common.BaseUtility;

public class MailBean {
	private String recipient; // who receives mails
	private String dispatcher; // who sends mails
	private String host; // the host for dispatcher
	private String userId; // the user id for dispatcher
	private String password; // the password for dispatcher
	private String subject; // mail title
	private String content; // mail content
	
	public MailBean(){
		initialize();
	}
	
	public MailBean(String to, String subject, String content){
		this.recipient = to;
		this.subject = subject;
		this.content = content;
		initialize();
	}
	
	private void initialize(){
		this.host = BaseUtility.getProperty("mail.dispatcher.smtp.host");
		this.dispatcher = BaseUtility.getProperty("mail.dispatcher.address");;
		this.userId = BaseUtility.getProperty("mail.dispatcher.id");
		this.password = BaseUtility.getProperty("mail.dispatcher.password");
	}

	public String getRecipient() {
		return recipient;
	}

	public void setRecipient(String recipient) {
		this.recipient = recipient;
	}

	public String getDispatcher() {
		return dispatcher;
	}

	public void setDispatcher(String dispatcher) {
		this.dispatcher = dispatcher;
	}

	public String getHost() {
		return host;
	}

	public void setHost(String host) {
		this.host = host;
	}

	public String getUserId() {
		return userId;
	}

	public void setUserId(String userId) {
		this.userId = userId;
	}

	public String getPassword() {
		return password;
	}

	public void setPassword(String password) {
		this.password = password;
	}

	public String getSubject() {
		return subject;
	}

	public void setSubject(String subject) {
		this.subject = subject;
	}

	public String getContent() {
		return content;
	}

	public void setContent(String content) {
		this.content = content;
	}
	
	public String toString(){
		StringBuffer buf = new StringBuffer();
		buf.append("\nHost: " + host);
		buf.append("\nUser: " + userId);
		buf.append("\npassword: " + password);
		buf.append("\nDispatcher: " + dispatcher);
		buf.append("\nRecipient: " + recipient);
		return buf.toString();
	}
}